package com.tianlang.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.jfinal.handler.Handler;
import com.tianlang.util.ToolWeb;

/**
 * 全局Handler
 * 
 * @author mcp
 *
 */
public class GlobalHandler extends Handler {

	private static Logger log = Logger.getLogger(GlobalHandler.class);

	@Override
	public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
		log.info("请求IP:" + ToolWeb.getIpAddr(request) + ",请求URL:" + target + ",参数:" + ToolWeb.getParamMap(request));
		next.handle(target, request, response, isHandled);
	}

}
